home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- function doexplode()
- {
- myColor.setTransform(myColorNormal);
- this.gotoAndStop("death");
- }
- function drawframe()
- {
- this.gotoAndStop("standing");
- }
- _X = _X - heroe.scrollspeed;
- _Y = _Y - heroe.vscrollspeed;
- _visible = false;
- hitable = this.hitTest(_parent.mascara);
- if(hitable)
- {
- _visible = true;
- if(this.sprite.hotzone.hitTest(heroe.sprite.hotzone))
- {
- heroe.damage = 2;
- heroe.hitted = true;
- }
- if(this.sprite.hotzone.hitTest(_parent.shoot1) && hitable)
- {
- hitted = true;
- _root.shoot1.impact = true;
- _root.hitted.start();
- }
- if(timerdamage == 0 && hitted)
- {
- timerdamage = FLASHTIME;
- currentdamage += DAMAGE;
- }
- if(timerdamage > 0)
- {
- flashing = true;
- timerdamage % 3 != 0 ? myColor.setTransform(myColorNormal) : myColor.setTransform(myColorTransform);
- timerdamage--;
- }
- if(flashing && timerdamage == 0)
- {
- flashing = false;
- myColor.setTransform(myColorNormal);
- hitted = false;
- }
- if(currentdamage >= MAXDAMAGE)
- {
- myColor.setTransform(myColorTransform);
- death = true;
- delete shoot;
- }
- if(death)
- {
- _root.shoot1.impact = false;
- doexplode();
- }
- }
- if(!death)
- {
- if(idle)
- {
- if(hitable)
- {
- idle = false;
- attack = true;
- }
- }
- if(attack)
- {
- _X = _X - 2;
- rad++;
- _Y = yi + 5 * Math.sin(3.141592653589793 * rad / 20);
- if(_X <= -64)
- {
- attack = false;
- _visible = false;
- }
- }
- drawframe();
- }
- }
-